<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Name       : Bryce Sunrise
Description: A three-column, fixed-width blog design.
Version    : 1.0
Released   : 20100501

-->
<%@include file="../includes/taglibs.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
      <script type="text/javascript">


    function actualizarServicios(){

       document.forms["formRepVentas"].accion.value = "filtrar"
       document.forms["formRepVentas"].submit();

    }
     function buscar(){
        
        var fecha1=document.forms["formRepVentas"].txtFechaIni.value
        var fecha2=document.forms["formRepVentas"].txtFechaFin.value
       if (compare_dates(fecha1, fecha2)){
            alert("Fecha de inicio es mayor a fecha de fin");
       }else{
            document.forms["formRepVentas"].accion.value = "buscar"
            document.forms["formRepVentas"].submit();
       }
   }

</script>

<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Proyecto Web GYM</title>
<meta name="keywords" content="" />
<meta name="Bryce Sunrise" content="" />
</head>
<body>
    

<!-- start header -->
<div id="header">
<%@include file="../includes/menu.jsp"%>

<!-- end header -->
<div id="wrapper">
  <!-- start page -->
  <div id="page">		
    
    <div align="left">
      <!-- start content -->
      <!-- end content -->
      <!-- start sidebars -->
    </div>
      <table width="384" border="0">
              <tr>
                <td width="400" height="35"><p class="Estilo1">REPORTE DE VENTAS</p>
                <p class="Estilo1">&nbsp;</p></td>
    </tr>
                 </table>
          <table width="384" border="0">
          <tr>
            <td width="400" height="35"><p class="Estilo1"></p>
                <p class="mensajeError">&nbsp;
                    <c:if test="${MENSAJE_REQUEST != null}">
                        <bean:message key="${MENSAJE_REQUEST}" />
                    </c:if>
                </p>
            </td>
          </tr>
       </table>
        
    <div class="div_tabla_resultado">
          <form id="formRepVentas" action="${ctx}/ReporteServlet" method="post" >
          <input type="hidden" name ="accion" id="accion"/>

        <table border="0" cellspacing="1" cellpadding="1" summary="Calendar" width="800" >
                
                <tbody>
                    <tr>
                        <td>Local</td>
                        <td> <select name="cboLocales" style="width:150px" onchange="//actualizarServicios();">
                                <option value=""><bean:message key="opciones.texto.todos" /></option>
                                 <c:forEach items="${LISTA_LOCALES_CONTEXTO}" var="local" >
                                 <c:if test="${local.codigo == LOCAL_REQUEST}" >
                                 <option value="${local.codigo}" selected>${local.nombre}</option>
                                 </c:if>
                                 <c:if test="${local.codigo != LOCAL_REQUEST}" >
                                 <option value="${local.codigo}">${local.nombre}</option>
                                 </c:if>
                                </c:forEach>
                             </select>
                        </td>
                    </tr>
                    <tr>
                        <td>Paquetes</td>
                        <td><select name="cboPaquete" id="cboPaquete" style="width:150px;" >
                        <option value=""><bean:message key="opciones.texto.todos" /></option>
                          <c:forEach items="${LISTA_PAQUETES_CONTEXTO}" var="paq" >
                              <option value="${paq.codigo}" >${paq.nombre}</option>
                          </c:forEach>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>Fecha Inicio</td>

                        <td><input type="text" value="01/01/2010" name="txtFechaIni" id ="txtFechaIni" onkeypress="return onlyNumbers(event)" size="12" onblur="validarFormatoFecha(this.value)" maxlength="10" />&nbsp;(dd/mm/yyyy)</td>
                    </tr>
                    <tr>
                        <td>Fecha Termino</td>
                        <td><input type="text" value="01/01/2020" name="txtFechaFin" id="txtFechaFin" onkeypress="return onlyNumbers(event)" size="12" onblur="validarFormatoFecha(this.value)" maxlength="10" />&nbsp;(dd/mm/yyyy)</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td></td>
                             
                        <td colspan="4"  align="right">
                            <input type="button" value="Buscar" class="boton" onclick="buscar()" OnClick="validarfechas()"/>
                        </td>
                        <td></td>
                    </tr>
                </tbody>
            </table>
           
          </form>
           <c:if test="${LISTA_REPORTES_REQUEST != null}" >

            <table border="1" cellspacing="1" cellpadding="1" width="800">
                <thead>
                    <tr>
                        <th>Local</th>
                        <th>Paquetes</th>
                        <th>Matriculados</th>
                        <th>S./ Monto</th>
                    </tr>
                </thead>
                <tbody>
                    <c:forEach items="${LISTA_REPORTES_REQUEST}" var="reporte" >
                        <tr>
                        <td>${reporte.local.nombre}</td>
                        <td>${reporte.paquete.nombre}</td>
                        <td>${reporte.matriculados}</td>
                        <td>${reporte.monto}</td>

                    </tr>

                                </c:forEach>
                       
                </tbody>
            </table>

        </div>
         
        <table border="0" cellspacing="1" cellpadding="1" width="800">
            <tr>
                <td align="right">
                Total : ${TOTAL_REPORTE_REQUEST}
                 </c:if>
                </td>
            </tr>
        </table>
      </div>
    
   
    <!-- end sidebars -->
    <div style="clear: both;">
      </div>
  </div>
  <!-- end page -->
  <div align="center"></div>
</div>
<div id="footer">
  <div id="footer-content">
   
  </div>
</div>
</body>
</html>
